home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / spchauto / data1.cab / Samples / Visual_C++ / Editor / SpellTxt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.1 KB  |  82 lines

  1. /********************************************************************
  2.                       SPELLTXT.CPP
  3. ********************************************************************/
  4.  
  5. #ifndef __SPELLTXT_H
  6. #define __SPELLTXT_H
  7.  
  8.  
  9. #include "MfcSpell.h"
  10.  
  11.  
  12. class   TSpellText
  13. {
  14.   private:
  15.    int    m_SpellBegPos;        // Editor position from which spelling is executed
  16.    int    m_SpellEndPos;        // Editor position to which spelling is executed
  17.    int    m_WordBegPos;         // beginning of word which is being edited
  18.    int    m_WordEndPos;         // end of word which is being edited
  19.  
  20.    BOOL FindNotExistInBoundary(); // Executes loop within m_SpellBegPos and m_SpellEndPos
  21.    int  GetFirstWordPos(int pos, BOOL fInclBackPos, BOOL fInclSingleQuote,
  22.                             BOOL fIgnoreTexKeywords, int *pWordStartPos, int *pWordEndPos);
  23.  
  24.  public:
  25.  
  26.    // vars
  27.    char m_szString [ 64 ];
  28. //   char m_szSuggested[128]; // pointer to buffer in which suggestions to the
  29. //                            // word which is not in dictionary are received
  30.  
  31.    CEditView*        m_pEditView;
  32.    TSpellingChecker* m_pSpellChecker;
  33.  
  34.  public: // functions
  35.    TSpellText(CEditView *pEditView, TSpellingChecker *pSpellChecker);
  36.    ~TSpellText();
  37.  
  38.    BOOL StartSpell(int, int);     // start of spelling, showing dialog...
  39.    void SelectNotExistSpellWord();
  40.    BOOL FindNextNotExistWord();
  41.    void ReplaceWord(const char *pszWordForReplace);
  42. };
  43.  
  44.  
  45. // local class
  46.  
  47. class TSpellDlg : public CDialog
  48. {
  49.  private:
  50.    TSpellText *  m_pSpellDocument;
  51.  public:
  52.    TSpellDlg(CWnd *, TSpellText *);
  53.    virtual BOOL OnInitDialog();
  54.    void CBEditChange_Suggest();
  55.    void CmIgnore();
  56.    void CmIgnoreAll();
  57.    void CmChange();
  58.    void CmChangeAll();
  59.    void CmSuggest();
  60.    void CmAdd();
  61.    void CmOptions();
  62.  private:
  63.    void GoToNextWord();
  64.  
  65.     DECLARE_MESSAGE_MAP()
  66. };
  67.  
  68.  
  69. class TSpellOptionsDynamicDlg : public CDialog
  70. {
  71.  private:
  72.    TSpellText *m_pSpellDocument;
  73.  public:
  74.    TSpellOptionsDynamicDlg(CWnd *, TSpellText *);
  75.    virtual BOOL OnInitDialog();
  76.    void OnOK();
  77.  
  78.     DECLARE_MESSAGE_MAP()
  79. };
  80.  
  81. #endif
  82.